package com.lkj.utils;

import java.io.Serializable;

public class PageUtil implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 1L;


    private int pagesize; //页数
    private int currentPage; //当前页
    private int totalpage;//总页数
    private String context;
    private String isOrder;
    private int currentnum;
    private int totalnum;

    private String status;

    public PageUtil() {
        super();
    }


    public PageUtil(int pagesize, int currentPage, String context, String isOrder, int total) {
        super();
        this.totalnum = total;
        this.pagesize = pagesize;
        this.currentPage = currentPage;
        this.context = context;
        this.isOrder = isOrder;
        this.totalpage = (int) Math.ceil(1.0 * total / pagesize);
        this.currentnum = (currentPage - 1) * pagesize;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setCurrentnum(int currentnum) {
        this.currentnum = currentnum;
    }


    public int getCurrentNum() {
        return currentnum;
    }

    public int getPagesize() {
        return pagesize;
    }

    public void setPagesize(int pagesize) {
        this.pagesize = pagesize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getTotalpage() {
        return totalpage;
    }

    public void setTotalpage(int totalpage) {
        this.totalpage = totalpage;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public String getIsOrder() {
        return isOrder;
    }

    public void setIsOrder(String isOrder) {
        this.isOrder = isOrder;
    }


    public int getTotalnum() {
        return totalnum;
    }


    public void setTotalnum(int totalnum) {
        this.totalnum = totalnum;
        this.totalpage = (int) Math.ceil(1.0 * totalnum / pagesize);
        this.currentnum = (currentPage - 1) * pagesize;
    }


}
